Skip to content

[O2B-1558] Set filters from url upon page reload#2144

Open
NarrowsProjects wants to merge 33 commits into
mainfrom
feature/O2B-1558/Set-filters-from-URL-upon-page-reload
Open

[O2B-1558] Set filters from url upon page reload#2144
NarrowsProjects wants to merge 33 commits into
mainfrom
feature/O2B-1558/Set-filters-from-URL-upon-page-reload

Conversation

@NarrowsProjects
Copy link
Copy Markdown
Collaborator

@NarrowsProjects NarrowsProjects commented Apr 27, 2026

I have a JIRA ticket

  • branch and/or PR name(s) include(s) JIRA ID
  • issue has "Fix version" assigned
  • issue "Status" is set to "In review"
  • PR labels are selected

Notable changes for users:

  • When a filters on overview pages are set, the active filters will appear in the url, when reloading the page, these filters will be applied automatically.
  • Users can now 'undo' filters by pressing the go-back button in the browser

Notable changes for developers:

  • The eorReason filter component has been changed to match its reasonType and Category with its model

  • A textInputFilter has been replaced by a textFilter as the model that controls it is a TextTokenFilterModel.

    • This prevented it from being set by the url as their state is different.
  • A guard has been added in the registerObservablesQcSummaryDependsOn function to prevent continual re-registration

  • A new getter has been added to filterModel and selectionModel called isInactive that will by default act as an alias for the isEmpty getter

    • The distinction is that isEmpty is used to determine if the filter should be added to requests or be set to the url while isInactive determines if specific ui interactions should happen (e.g. toggles being considered inactive despite being filled with 'false', thus being added urls, but not enabling the reset-filter button, as you can't reset an already untoggled toggle)
  • ToggleFilters will now ALWAYS be filled, meaning that they will always be added to the query parameters.

    • This was already the case for all toggles except for HasStableBeams, which would only be added if it was true.

Changes made to the database:

  • N/A

@NarrowsProjects NarrowsProjects self-assigned this Apr 27, 2026
@NarrowsProjects NarrowsProjects added frontend javascript Pull requests that update Javascript code labels Apr 27, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

❌ Patch coverage is 0% with 98 lines in your changes missing coverage. Please review.
✅ Project coverage is 45.73%. Comparing base (7a03dd1) to head (87a5941).

Files with missing lines Patch % Lines
lib/public/views/Runs/Overview/RunsWithQcModel.js 0.00% 14 Missing ⚠️
...public/components/Filters/common/FilteringModel.js 0.00% 13 Missing ⚠️
...blic/components/common/selection/SelectionModel.js 0.00% 11 Missing ⚠️
...ib/public/views/Logs/Overview/LogsOverviewModel.js 0.00% 10 Missing ⚠️
...onents/Filters/common/filters/ToggleFilterModel.js 0.00% 6 Missing ⚠️
lib/public/views/Runs/RunsModel.js 0.00% 4 Missing ⚠️
...c/views/LhcFills/Overview/LhcFillsOverviewModel.js 0.00% 3 Missing ⚠️
...Runs/RunPerPeriod/RunsPerLhcPeriodOverviewModel.js 0.00% 3 Missing ⚠️
...mulationPass/RunsPerSimulationPassOverviewModel.js 0.00% 3 Missing ⚠️
.../Filters/RunsFilter/MultiCompositionFilterModel.js 0.00% 2 Missing ⚠️
... and 18 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2144      +/-   ##
==========================================
- Coverage   45.88%   45.73%   -0.16%     
==========================================
  Files        1035     1035              
  Lines       17165    17225      +60     
  Branches     3123     3133      +10     
==========================================
  Hits         7877     7877              
- Misses       9288     9348      +60     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@NarrowsProjects NarrowsProjects changed the base branch from main to impov/O2B-1555/Add-normalize-setter-functions-to-all-classes-that-extend-FilterModel-and-SelectionModel April 27, 2026 07:50
@NarrowsProjects NarrowsProjects force-pushed the feature/O2B-1558/Set-filters-from-URL-upon-page-reload branch 4 times, most recently from 82c8d41 to e157e08 Compare April 29, 2026 08:41
@NarrowsProjects NarrowsProjects force-pushed the impov/O2B-1555/Add-normalize-setter-functions-to-all-classes-that-extend-FilterModel-and-SelectionModel branch 5 times, most recently from beca3c1 to 319bb4d Compare May 11, 2026 06:50
@NarrowsProjects NarrowsProjects force-pushed the feature/O2B-1558/Set-filters-from-URL-upon-page-reload branch 2 times, most recently from 767f763 to 6add680 Compare May 25, 2026 16:50
Base automatically changed from impov/O2B-1555/Add-normalize-setter-functions-to-all-classes-that-extend-FilterModel-and-SelectionModel to main May 26, 2026 14:19
@NarrowsProjects NarrowsProjects force-pushed the feature/O2B-1558/Set-filters-from-URL-upon-page-reload branch from 6add680 to d23795c Compare May 27, 2026 08:52
Copy link
Copy Markdown
Member

@graduta graduta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment for general description of the PR, it does more than what you mention:

  • changes the use of textInput component
  • changes EOR
  • adds the logger

Comments for the logger - as you are introducing lots of duplicated code, I belive this would be better to be added as a middleware method and separate ticket
Comment for the call to set from URL. Could this not be added in a common space, perhaps something like in the setter of pageIdentifier?

Comment thread lib/public/components/Filters/common/FilteringModel.js Outdated
Comment thread lib/public/components/Filters/common/FilteringModel.js Outdated
Comment thread lib/public/components/Filters/common/FilteringModel.js Outdated
Comment thread test/public/Filters/index.js Outdated
Comment thread lib/server/controllers/dataPasses.controller.js Outdated
Comment thread lib/public/views/Runs/Overview/RunsWithQcModel.js Outdated
Comment thread lib/server/Loggers/FilterLogger.js Outdated
Comment thread lib/public/views/Runs/RunPerPeriod/RunsPerLhcPeriodOverviewModel.js
@NarrowsProjects NarrowsProjects requested a review from graduta May 27, 2026 13:26
Copy link
Copy Markdown
Member

@graduta graduta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I identified a bug that needs to be taken care of:

  • open a summary page (let's say logs)
  • set a filter (let's say "No Anonymous")
  • pages succesfully gets updated and the URL as well
  • use the browser "Go Back" navigation button
  • URL gets updated but the request towards the backend will still contain the filter applied

When fixing the test, please add a test for this scenario as well

Comment thread lib/public/views/Environments/Overview/EnvironmentOverviewModel.js
Comment thread test/public/Filters/index.js Fixed
@NarrowsProjects NarrowsProjects requested a review from graduta May 28, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend javascript Pull requests that update Javascript code

Development

Successfully merging this pull request may close these issues.

2 participants